<%@ page language="java" contentType="text/html;charset=utf-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->
<html lang="zh-cn" class="no-js">
<!--<![endif]-->
<head>
    <jsp:include page="/common/common.jsp"/>
    <link rel="stylesheet" type="text/css" href="${path}/assets/plugins/select2/select2.css"/>
    <link rel="stylesheet" type="text/css" href="${path}/assets/plugins/select2/select2-metronic.css"/>
</head>
<body class="page-header-fixed">
<jsp:include page="/common/header.jsp"/>
<div class="clearfix">
</div>
<div class="page-container">
    <div class="page-sidebar-wrapper"><jsp:include page="/common/menu.jsp"/></div>
    <div class="page-content-wrapper">
        <div class="page-content">
            <div class="row">
                <div class="col-md-12">
                    <div class="portlet box purple">
                    
                        <div class="portlet-title">
                            <div class="caption">
                                <i class="fa fa-file-text-o"></i> 广告展示 
                            </div>
                            <div class="tools">
                                <div class="actions">
                                    <a href="${path}/adShow/edit" class="btn green"><i class="fa fa-plus"> 新增</i></a>
                                </div>
                            </div>
                        </div>
                        
                        <div class="portlet-body">
                            <form id="formQuery" class="form-horizontal" action="${path}/adShow/list">
                                <div class="form-body">
                                    
                                    <div class="form-group">
                                        <label class="col-md-1 control-label">名称</label>
                                        <div class="col-md-2">
                                            <input type="text" id="name" name="name" class="form-control"/>
                                        </div> 
                                         
                                        <label class="col-md-1 control-label">状态</label>
                                        <div class="col-md-2">
                                            <select id="status" name="status" class="form-control">
                                                <option value="">所有</option>
                                                <option value="0">已发布</option>
                                                <option value="1">已下架</option>
                                                <option value="2">审核中</option>
                                                <option value="3">审核不通过</option>
                                            </select>
                                        </div>
                              </div>   
                                <div class="form-group">
                                	<label class="col-md-1 control-label">发布时间</label>
                                        <div class="col-md-4">
                                            <div class="input-group input-large date-picker input-daterange"
                                                 data-date-format="yyyy-mm-dd">
                                                <input type="text" class="form-control" id="fromDate" name="createTime" value="${entity.createTime.split(",")[0]}"
                                                       readonly="readonly" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"/>
                                                <span class="input-group-addon">to</span>
                                                <input type="text" class="form-control" id="toDate" name="createTime" value="${entity.createTime.split(",")[1]}"
                                                       readonly="readonly" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"/>
                                            </div>
                                        </div>
                                        <div class="col-md-1">
                                            <button type="button" class="btn green" onclick="getadShowList()">查询</button>      <!-- e 查询直接调用getNewsList() 在本末的script中-->
                                        </div>
                                </div>
                                </div>
                            </form>
                            <table class="table table-striped table-bordered table-hover" id="adShowList"></table>   
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<jsp:include page="/common/footer.jsp"/>
<script type="text/javascript" src="${path}/assets/plugins/calendar/WdatePicker.js"></script>
<script type="text/javascript" src="${path}/assets/plugins/district/linkagesel-min.js"></script>
<script type="text/javascript" src="${path}/audit/adShow/js/adShow.js"></script>    
<script type="text/javascript" src="${path}/audit/adShow/js/json2.js"></script>       
<script type="text/javascript" >
    var msg = '${msg}';
    $(function () {
        if(msg){
        	App.bubble(200, msg);      
        }
        getadShowList(); 
        $('#pid').change(function() {
            changeSecondType(this.value);
        });
    });
    function changeSecondType(pid) {
        $.ajax({
            url: _path + '/conf/queryConfTByPid?pid='+pid,
            type: 'GET',
            success: function(resp) {
                $("#columnId").html('');
                new LinkageSel({
                    dataReader: {id: 'id', name: 'value0'},
                    data: resp.dataList,
                    selStyle: 'margin-left: 3px;',
                    select:  '#columnId'
                });
            }
        });
    }
</script>
</body>
</html>